<?php
namespace app\admin\controller;
use think\Controller;
use Think\Db;
use think\Session;
use think\Request;

class Base extends Controller
{
    public function __construct(Request $request)
    {
        parent::__construct();
        if( !(Session::has('username')) )
        {
            $this->redirect('/admin/login/login');
        }/*else
        {
            define('CONTROLLER_NAME',Request::instance()->controller());
            //define('MODULE_NAME',Request::instance()->module());
            //define('ACTION_NAME',Request::instance()->action());
            $perm_list = getPermList();
            if( !in_array("CONTROLLER_NAME",$perm_list) ){
                $this->error('你没有权限访问此模块！');
            }
        }*/
    }
}
